<?php
/*
 * http://phpnow.org YinzCN_at_Gmail.com
 */
error_reporting ( E_ALL );
define ( 'TimeZone', + 8.0 );
function _GET($n) {
	return isset ( $_GET [$n] ) ? $_GET [$n] : NULL;
}
function _SERVER($n) {
	return isset ( $_SERVER [$n] ) ? $_SERVER [$n] : '[undefine]';
}
if (_GET ( 'act' ) == 'phpinfo') {
	if (function_exists ( 'phpinfo' ))
		phpinfo ();
	else
		echo 'phpinfo() has been disabled.';
	exit ();
}
$Info = array ();
$Info ['php_ini_file'] = function_exists ( 'php_ini_loaded_file' ) ? php_ini_loaded_file () : '[undefine]';

if (_GET ( 'act' ) == 'getip') {
	$i = _SERVER ( 'SERVER_NAME' ) . '|' . _SERVER ( 'REMOTE_ADDR' ) . '|' . _SERVER ( 'SERVER_SOFTWARE' ) . '|' . (function_exists ( 'mysql_close' ) ? mysql_get_client_info () : '') . '|' . _SERVER ( 'DOCUMENT_ROOT' );
	$c = @file_get_contents ( 'http://phpnow.org/myip.php?' . base64_encode ( $i ) );
	if (preg_match ( '/^\d+\.\d+\.\d+\.\d+$/', $c ) == 1)
		echo $c;
	else
		echo 'false';
	exit ();
}
function colorhost() {
	$c = array (
			'#87cefa',
			'#ffa500',
			'#ff6347',
			'#9acd32',
			'#32cd32',
			'#ee82ee' 
	);
	$a = str_split ( _SERVER ( 'SERVER_NAME' ) );
	$k = $l = 0;
	foreach ( $a as &$d ) {
		while ( $k == $l )
			$k = array_rand ( $c );
		$d = '<b style="color: ' . $c [$k] . ';">' . $d . '</b>';
		$l = $k;
	}
	return implode ( '', $a );
}
function get_ea_info($name) {
	$ea_info = eaccelerator_info ();
	return $ea_info [$name];
}
function get_gd_info($name) {
	$gd_info = gd_info ();
	return $gd_info [$name];
}

define ( 'YES', '<span style="color: #008000; font-weight : bold;">Yes</span>' );
define ( 'NO', '<span style="color: #ff0000; font-weight : bold;">No</span>' );
?>
<?php 
//面包屑
$this->breadcrumbs=array(
	'综合控制台首页'=>array('index'),
);
//未付款订单:
$order_waite_pay = Order::model()->countByAttributes(array('zo_status'=>1,'zo_pay_status'=>1));
//待发货订单
$order_waite_exp = Order::model()->countByAttributes(array('zo_status'=>1,'zo_pay_status'=>2,'zo_exp_status'=>1));
//待审核商家资讯
$cmpNews_waite = CmpNews::model()->countByAttributes(array('zcn_status'=>1));
//待审核商家会员
$cmpany_waite = CompanyCard::model()->countByAttributes(array('zoa_check'=>1));
//待处理退款
$refund_waite = Refund::model()->countByAttributes(array('zr_pay_status'=>3));
//待处理投诉
$complain_waite = MemReport::model()->countByAttributes(array('zmr_status'=>array(1,2),'zmr_type'=>2));
//待处理举报
$memReport_waite = MemReport::model()->countByAttributes(array('zmr_status'=>array(1,2),'zmr_type'=>1));
//待处理违规
$cmpPunish_waite = CmpPunish::model()->countByAttributes(array('zcu_del'=>1));
//待审核产品
$product_waite = Product::model()->countByAttributes(array('zp_status'=>1));
?>
<div class="index_tab">
	<div class="mem_info c_f">
		<p>管理员名称：<?php echo CHtml::encode($adminer->zda_name)?></p>
		<p>管理员角色：<?php echo CHtml::encode($adminer->role_log[0]->role->zao_title)?></p>
	</div>
	<div class="info">
		<ul>
			<li>
				<span class="tit">订单信息：</span>
				<?php echo CHtml::link("未付款订单（<strong class='c_f60'>".$order_waite_pay."</strong>）",array($this->pre_module_url.'/order/admin','Order[zo_status]'=>1,'Order[zo_pay_status]'=>1))?>
				<?php echo CHtml::link("待发货订单（<strong class='c_f60'>".$order_waite_exp."</strong>）",array($this->pre_module_url.'/order/admin','Order[zo_status]'=>1,'Order[zo_pay_status]'=>2,'Order[zo_exp_status]'=>1))?>
			</li>
			<li>
				<span class="tit">产品信息：</span>
				<?php echo CHtml::link("待审核产品（".$product_waite."）",array($this->pre_module_url.'/productWaitCheck/admin'))?>
			</li>
			<li>
				<span class="tit">资讯信息：</span>
				<?php echo CHtml::link("待审核商家资讯（".$cmpNews_waite."）",array($this->pre_module_url.'/cmpNews/admin','CmpNews[check_type]'=>1))?>
			</li>
			<li>
				<span class="tit">会员信息：</span><a href="javascript:">待审核商家会员（0）</a>
				<?php echo CHtml::link("待审核商家会员（".$cmpany_waite."）",array($this->pre_module_url.$this->pre_module_url.'Card/admin','CompanyCard[zoa_check]'=>1))?>
			</li>
			<li>
				<span class="tit">客户服务：</span>
				<?php echo CHtml::link("待处理退款（".$refund_waite."）",array($this->pre_module_url.'/refund/admin','Refund[zr_pay_status]'=>3))?>
				<?php echo CHtml::link("待处理投诉（".$complain_waite."）",array($this->pre_module_url.'/complain/admin','MemReport[zmr_status]'=>array(1,2)))?>
				<?php echo CHtml::link("待处理举报（".$memReport_waite."）",array($this->pre_module_url.'/memReport/admin','MemReport[zmr_status]'=>array(1,2)))?>
				<?php echo CHtml::link("待处理违规（".$cmpPunish_waite."）",array($this->pre_module_url.'/cmpPunish/admin'))?>
			</li>
		</ul>
	</div>
	<table class="servise_info">
		<tr>
			<td class="item">服务器名称</td>
			<td><?=_SERVER('SERVER_NAME')?></td>
			<td class="item">服务器地址/端口</td>
			<td><?=_SERVER('SERVER_ADDR').':'._SERVER('SERVER_PORT')?></td>
		</tr>
		<tr>
			<td class="item">服务器软件</td>
			<td><?=stripos(_SERVER('SERVER_SOFTWARE'), 'PHP')?_SERVER('SERVER_SOFTWARE'):_SERVER('SERVER_SOFTWARE').' PHP/'.PHP_VERSION?></td>
			<td class="item">PHP_SAPI</td>
			<td><?=PHP_SAPI?></td>
		</tr>
		<tr>
			<td class="item">网站主目录</td>
			<td><?=_SERVER('DOCUMENT_ROOT')?></td>
			<td class="item">服务器时间</td>
			<td><?=gmdate('Y-m-d', time()+TimeZone*3600)?> <?=gmdate('H:i:s', time()+TimeZone*3600)?> <span
				style="color: #999999;">(<?=(TimeZone<0?'-':'+').gmdate('H:i', abs(TimeZone)*3600)?>)</span></td>
		</tr>
		<tr>
			<td class="item">MySQL 支持</td>
			<td><?=function_exists('mysql_close') ? YES.' / client lib version '.mysql_get_client_info() : NO?></td>
			<td class="item">GD 库支持</td>
			<td><?=function_exists('gd_info') ? YES.' / '.get_gd_info('GD Version') : NO?></td>
		</tr>
	</table>
</div>


